﻿<%@ Page Title="" Language="C#" MasterPageFile="/Administrator/Site1.Master" AutoEventWireup="true"
    CodeBehind="ManagerStaff.aspx.cs" Inherits="TIS.Administrator.ManagerStaff" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="workplace">
        <div class="row-fluid">
            <div class="span12">
                <div class="head">
                    <div class="isw-documents">
                    </div>
                    <h1>
                        Quản lý nhân viên</h1>
                    <div class="clear">
                    </div>
                </div>
                <div class="block-fluid">
                    <div style="padding-left: 15px; text-align: center;">
                        <asp:UpdatePanel ID="udpError" runat="server" UpdateMode="Always">
                            <ContentTemplate>
                                <asp:Label ID="lblError" runat="server" ForeColor="Red" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                    <div style="padding-left: 15px; text-align: center;">
                        <asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="false">
                            <ProgressTemplate>
                                <img src="../images/loading-small.gif" /><asp:Label ID="lblLoading" runat="server"
                                    Text="&#272;ang t&#7843;i d&#7919; li&#7879;u..." />
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </div>
                    <asp:PlaceHolder ID="plhMain" runat="server">
                        <table width="100%" cellpadding="2" cellspacing="2" border="0" style="margin-left: 15px;">
                            <tr valign="top">
                                <td>
                                    <asp:Panel ID="pnUserList" runat="server" GroupingText="Danh sách ng&#432;&#7901;i dùng"
                                        Width="400px">
                                        <table cellpadding="2" cellspacing="2" border="0" style="margin-left: 5px; margin-right: 5px;">
                                            <tr class="row-form">
                                                <td width="120">
                                                    Tên &#273;&#259;ng nh&#7853;p
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtUser" runat="server"></asp:TextBox>&nbsp;&nbsp;
                                                    <div class="clear">
                                                    </div>
                                                    <asp:Button ID="btnSearch" runat="server" Text="Tìm" OnClick="btnSearch_Click" CssClass="btn"
                                                        Width="78px" />
                                                </td>
                                            </tr>
                                        </table>
                                        <asp:UpdatePanel ID="udpGrvUser" runat="server" UpdateMode="Conditional">
                                            <ContentTemplate>
                                                <%--<ajaxc:TabContainer ID="tbcGrvUser" runat="server" AutoPostBack="true"></ajaxc:TabContainer>--%>
                                                <asp:GridView ID="grvUser" runat="server" Width="100%" PageSize="10" AllowPaging="true"
                                                    AutoGenerateColumns="False" PagerSettings-PreviousPageText="Prev" PagerStyle-CssClass="pagerText"
                                                    OnRowCommand="grvUser_RowCommand" OnRowDeleting="grvUser_RowDeleting" OnRowEditing="grvUser_RowEditing"
                                                    EmptyDataText="Không có b&#7843;n ghi nào" OnPageIndexChanging="grvUser_PageIndexChanging">
                                                    <PagerSettings PageButtonCount="10" Position="Bottom" Visible="true" />
                                                    <FooterStyle BackColor="#1EB5DD" Font-Bold="True" ForeColor="White" />
                                                    <PagerStyle BackColor="#1EB5DD" ForeColor="White" />
                                                    <RowStyle BackColor="#8ec0dc" ForeColor="#333333" HorizontalAlign="Center" Height="20px"
                                                        VerticalAlign="Middle" />
                                                    <SelectedRowStyle BackColor="Silver" Font-Bold="True" ForeColor="#333333" />
                                                    <HeaderStyle BackColor="#1EB5DD" Font-Bold="True" ForeColor="White" Height="22px"
                                                        VerticalAlign="Middle" />
                                                    <EditRowStyle BackColor="#999999" />
                                                    <AlternatingRowStyle BackColor="#a4e4f5" ForeColor="#284775" />
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="STT">
                                                            <ItemTemplate>
                                                                <%# Container.DataItemIndex + 1 %></ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Tên &#273;&#259;ng nh&#7853;p" ItemStyle-HorizontalAlign="left">
                                                            <ItemTemplate>
                                                                <%# Eval("Username")%></ItemTemplate>
                                                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField>
                                                            <HeaderTemplate>
                                                                S&#7917;a</HeaderTemplate>
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="lkbEdit" runat="server" CausesValidation="false" CommandName="Edit"
                                                                    Text="S&#7917;a" CommandArgument='<%# Eval("Username") %>'></asp:LinkButton>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField>
                                                            <HeaderTemplate>
                                                                M&#7853;t kh&#7849;u</HeaderTemplate>
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="lkbResetPass" runat="server" CausesValidation="false" CommandName="Reset"
                                                                    Text="&#272;&#7863;t l&#7841;i" CommandArgument='<%# Eval("Username") %>'></asp:LinkButton>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField>
                                                            <HeaderTemplate>
                                                                Xóa</HeaderTemplate>
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="lkbDelete" runat="server" CausesValidation="false" CommandName="Delete"
                                                                    Text="Xóa" CommandArgument='<%# Eval("Username") %>'></asp:LinkButton>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                </asp:GridView>
                                                <div style="padding-top: 5px;">
                                                    <asp:Button ID="btnNew" runat="server" Width="80px" Text="Thêm m&#7899;i" OnClick="btnNew_Click"
                                                        CssClass="btn" /></div>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                                                <asp:AsyncPostBackTrigger ControlID="grvUser" EventName="PageIndexChanging" />
                                                <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
                                            </Triggers>
                                        </asp:UpdatePanel>
                                    </asp:Panel>
                                </td>
                                <td>
                                    <asp:UpdatePanel ID="udpDetail" runat="server" UpdateMode="Conditional">
                                        <ContentTemplate>
                                            <asp:MultiView ID="mvDetail" runat="server">
                                                <asp:View ID="vDetail" runat="server">
                                                    <asp:Panel ID="pnDetail" runat="server" Width="350" Enabled="false" EnableViewState="true"
                                                        GroupingText="Thông tin chi ti&#7871;t ng&#432;&#7901;i dùng">
                                                        <table border="0" cellpadding="2" cellspacing="2" style="padding-left: 5px">
                                                            <tr>
                                                                <td>
                                                                    Tên &#273;&#259;ng nh&#7853;p:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtUserName" runat="server" Width="150px" MaxLength="50" />
                                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtUserName"
                                                                        ErrorMessage="*" SetFocusOnError="True" EnableClientScript="false"></asp:RequiredFieldValidator>
                                                                </td>
                                                            </tr>
                                                            <asp:Panel ID="pnPass" runat="server">
                                                                <tr>
                                                                    <td>
                                                                        M&#7853;t kh&#7849;u:
                                                                    </td>
                                                                    <td>
                                                                        <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" Width="150px" MaxLength="50" />
                                                                    </td>
                                                                </tr>
                                                            </asp:Panel>
                                                            <tr>
                                                                <td>
                                                                    Họ tên:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtFullName" runat="server" Width="150px" MaxLength="50" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Email:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtEmail" runat="server" Width="150px" MaxLength="50" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Điện thoại:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtMobile" runat="server" Width="150px" MaxLength="50" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Địa chỉ:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtAddress" runat="server" Width="150px" MaxLength="50" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Ch&#7913;c v&#7909;:
                                                                </td>
                                                                <td>
                                                                    <asp:DropDownList runat="server" ID="ddlChucVu">
                                                                    </asp:DropDownList>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Ngày t&#7841;o:
                                                                </td>
                                                                <td>
                                                                    <asp:Label ID="lblDateCreate" runat="server" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                </td>
                                                                <td>
                                                                    <asp:Button ID="btnSave" runat="server" Width="80px" Text="L&#432;u l&#7841;i" OnClick="btnSave_Click"
                                                                        CssClass="btn" />
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </asp:Panel>
                                                </asp:View>
                                                <asp:View ID="vResetPass" runat="server">
                                                    <asp:Panel ID="pnChangePass" runat="server" Width="350px" GroupingText="&#272;&#7863;t l&#7841;i m&#7853;t kh&#7849;u cho ng&#432;&#7901;i dùng">
                                                        <table border="0" cellpadding="2" cellspacing="2" style="padding-left: 5px">
                                                            <tr>
                                                                <td>
                                                                    Tên &#273;&#259;ng nh&#7853;p:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtUserNameCP" runat="server" Width="150px" MaxLength="50" Enabled="false" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    M&#7853;t kh&#7849;u m&#7899;i:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtPasswordCP" TextMode="Password" runat="server" Width="150px"
                                                                        MaxLength="50" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                </td>
                                                                <td>
                                                                    <asp:Button ID="btnReset" runat="server" Width="80px" Text="&#272;&#7863;t l&#7841;i"
                                                                        OnClick="btnReset_Click" CssClass="btn" />&nbsp;<asp:Button ID="btnCancel" runat="server"
                                                                            Width="80px" Text="H&#7911;y b&#7887;" OnClick="btnCancel_Click" CssClass="btn" />
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </asp:Panel>
                                                </asp:View>
                                                <asp:View ID="vPermission" runat="server">
                                                    <asp:Panel ID="pPermission" runat="server" Width="350px" GroupingText="Phân quy&#7873;n cho ng&#432;&#7901;i dùng">
                                                        <table border="0" cellpadding="2" cellspacing="2" style="padding-left: 5px">
                                                            <tr>
                                                                <td>
                                                                    Tên &#273;&#259;ng nh&#7853;p:
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtUserNamePM" runat="server" Enabled="false" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td colspan="2">
                                                                    <asp:GridView ID="grvPermision" runat="server" AutoGenerateColumns="False" EmptyDataText="Không có b&#7843;n ghi nào"
                                                                        DataKeyNames="RoleID">
                                                                        <FooterStyle BackColor="#1EB5DD" Font-Bold="True" ForeColor="White" />
                                                                        <RowStyle BackColor="#8ec0dc" ForeColor="#333333" HorizontalAlign="Center" Height="20px"
                                                                            VerticalAlign="Middle" />
                                                                        <SelectedRowStyle BackColor="Silver" Font-Bold="True" ForeColor="#333333" />
                                                                        <HeaderStyle BackColor="#1EB5DD" Font-Bold="True" ForeColor="White" Height="22px"
                                                                            VerticalAlign="Middle" />
                                                                        <EditRowStyle BackColor="#999999" />
                                                                        <AlternatingRowStyle BackColor="#a4e4f5" ForeColor="#284775" />
                                                                        <Columns>
                                                                            <asp:TemplateField HeaderText="Module" ItemStyle-HorizontalAlign="left">
                                                                                <ItemTemplate>
                                                                                    <%# Eval("Module")%></ItemTemplate>
                                                                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                                                                            </asp:TemplateField>
                                                                            <asp:TemplateField HeaderText="Ch&#7913;c n&#259;ng" ItemStyle-HorizontalAlign="left">
                                                                                <ItemTemplate>
                                                                                    <%# Eval("RoleName")%></ItemTemplate>
                                                                                <ItemStyle HorizontalAlign="Left"></ItemStyle>
                                                                            </asp:TemplateField>
                                                                            <asp:TemplateField>
                                                                                <HeaderTemplate>
                                                                                    Cho phép</HeaderTemplate>
                                                                                <ItemTemplate>
                                                                                    <asp:CheckBox ID="chkPermit" runat="server" Checked='<%# (Eval("Permited").ToString() != "0" ? true : false) %>' />
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                        </Columns>
                                                                    </asp:GridView>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <asp:Button ID="btnSavePM" runat="server" Width="80px" Text="L&#432;u l&#7841;i"
                                                                        OnClick="btnSavePM_Click" CssClass="btn" />
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </asp:Panel>
                                                </asp:View>
                                            </asp:MultiView>
                                        </ContentTemplate>
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="grvUser" EventName="RowCommand" />
                                            <asp:AsyncPostBackTrigger ControlID="btnNew" EventName="Click" />
                                            <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
                                            <asp:AsyncPostBackTrigger ControlID="btnReset" EventName="Click" />
                                            <asp:AsyncPostBackTrigger ControlID="btnCancel" EventName="Click" />
                                        </Triggers>
                                    </asp:UpdatePanel>
                                </td>
                            </tr>
                        </table>
                    </asp:PlaceHolder>
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
        <div class="dr">
            <span></span>
        </div>
    </div>
</asp:Content>
